package com.lifeibiao.singleton;

import java.util.Scanner;

public class SingleTonTestdriver {
    public static void main(String[] args) {
        //获取单例模式类的一个实例对象
        Singleton st1 = Singleton.getSingletonInstance();
        //获取单例模式类的一个实例对象
        Singleton st2 = Singleton.getSingletonInstance();
        //判断这两个实例变量是不是同一个实例变量
        System.out.println("st1==st2:"+(st1==st2));
        System.out.println("st2.hashCode::"+st2.hashCode());
        System.out.println("st1.hashCode::"+st1.hashCode());

        System.out.println("--------------------");
        Student stu1 = new Student();
        Student stu2 = new Student();
        System.out.println("stu1==stu2:"+(stu1==stu2));
        System.out.println("stu1.hashCode::"+stu1.hashCode());
        System.out.println("stu2.hashCode::"+stu2.hashCode());
        Scanner scanner=null;
    }
}
